#include "SuperBtn.h"

CSuperBtn::CSuperBtn( QWidget* parent/*=0*/ )
	: QWidget(parent)
{
//	connect(this,SIGNAL(clicked()),this,SLOT(OnClicked()));
	m_bMousePressed=false;
}

CSuperBtn::~CSuperBtn(void)
{
}

void CSuperBtn::mousePressEvent( QMouseEvent* event )
{
	m_ptPrevious=event->pos();
	m_bMousePressed=true;
	OnMouseEnter();
	QWidget::mousePressEvent(event);
}

void CSuperBtn::mouseReleaseEvent( QMouseEvent* event )
{
	m_bMousePressed=false;
	OnMouseLeave();
	if((event->pos()-m_ptPrevious).manhattanLength()<50){
		OnClicked();
	}
	QWidget::mouseReleaseEvent(event);
}